package main

import (
	"fmt"
	"strings"
)

func main() {
	s := "左是楞经go发123"
	for i, ch := range []byte(s) {
		fmt.Printf("%d:%x:%v ", i, ch, ch)
	}
	fmt.Println()
	fmt.Println(strings.Contains(s, "左"))
	fmt.Println(strings.ContainsRune(s, '左'))
	for i, ch := range []byte("aardvark") {
		fmt.Printf("%d:%x:%v ", i, ch, ch)
	}
	fmt.Println(strings.ContainsRune("aardvark", 114))

	fmt.Println(strings.ContainsAny("team", "i"))
	fmt.Println(strings.ContainsAny("fail", "ui"))
	fmt.Println(strings.ContainsAny("ure", "ui"))
	fmt.Println(strings.ContainsAny("failure", "ui"))
	fmt.Println(strings.ContainsAny("foo", ""))
	fmt.Println(strings.ContainsAny("", ""))
	fmt.Println("------------------------------------")
	fmt.Println(strings.ContainsRune("d左右上下。golang.", 97))
	fmt.Println(strings.ContainsRune("d左右上下。golang.", 'a'))
	fmt.Println(strings.ContainsRune("d左右上下。golang.", '左'))
	fmt.Printf("%v:%+v:%#v:%T", "左", "左", "左", "左")
	fmt.Println()
	fmt.Printf("%s:%q:%x:%X", "左", "左", "左", "左")
	fmt.Println("------------------------------------")
	fmt.Println(strings.Count("cheese", "e"))
	fmt.Println(strings.Count("five", "")) // before & after each rune
	fmt.Println(strings.Count("左", ""))
	fmt.Println(strings.Count("", ""))
	fmt.Println(strings.Count("左右", ""))
	fmt.Println(strings.Count("左右左右上下左左右BAba", "左"))
	fmt.Println(strings.IndexByte("golang", ' '))
	fmt.Println(strings.IndexRune("ch工icken", 'k'))
	fmt.Println(strings.IndexRune("chicken", 'd'))
	fmt.Println(strings.IndexRune("chicken", 101))
	fmt.Println(strings.IndexRune("chic左ken", 101))
	recover()
}
